<?php 
include 'functions.php';
function upLoad(){
	foreach ($_FILES as $v) {
		foreach ($v as $key => $value) {
			foreach ($value as $k => $va) {
				if(IS_POST){
					if(is_uploaded_file($v['tmp_name'][$k])){
						$type = ltrim(strrchr($v['name'][$k],'.'),'.');
						$filName = time(). mt_rand(0,99999) . '.' .$type;
						$path = './upload' . date('ymd');
						is_dir($path) || mkdir($path,0777,true);
						$full = $path . '/' .$filName;
						move_uploaded_file($v['tmp_name'][$k], $full);
					}
				}
			}
		}
	}
}





upLoad();
 ?>
 
<html>
	<head>
		<title></title>
	</head>
	<body>
		<form action="" method="post" enctype="multipart/form-data">
		文件1：
			<input type="file" name="upfiles[]" id="" />
			<br />
			文件2：
			<input type="file" name="upfiles[]" id="" />
			<br />
			<input type="submit" value="上传
		</form>
	</body>
</html>